<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<head>
<sx:head cache="false" />
<link rel="stylesheet" href="/hrs-intranet/styles/displaytag.css"
	type="text/css" />
<script type="text/javascript"
	src="/hrs-intranet/custom/js/calendarFix.js"></script>
</head>

<s:form action="TimeOffAction_list" cssClass="formClass">

	<table width="50%">

		<tr>
			<td width="36%">
				<table align="right" style="text-align: right;">
					<sx:autocompleter list="employeeList" listValue="person.name"
						searchType="startword" listKey="id" showDownArrow="false"
						keyName="selectedEmployeeId" name="selectedEmployeeName"
						label="Employee" />
				</table>
			</td>

			<td width="14%">
				<table align="right" style="text-align: right;">
					<sx:datetimepicker name="selectedDateFrom" label="Date From"
						displayFormat="dd/MM/yyyy" valueNotifyTopics="/value" />
				</table>
			</td>
		</tr>

		<tr>
			<td width="36%">
				<table align="right" style="text-align: right;">
					<sx:autocompleter list="allTimeOffTypes" listValue="name"
						keyName="selectedTimeOffType" listKey="id" label="Time Off Type"
						showDownArrow="false" searchType="startword"
						forceValidOption="true" />
				</table>
			</td>

			<td width="14%">
				<table align="right" style="text-align: right;">
					<sx:datetimepicker name="selectedDateTo" label="Date To"
						displayFormat="dd/MM/yyyy" valueNotifyTopics="/value" />
				</table>
			</td>
		</tr>
		<tr>
			<td width="36%">
				<table align="right" style="text-align: right;">
					<sx:autocompleter list="allStatuses" label="Status"
						showDownArrow="false" searchType="startword" name="selectedStatus"
						forceValidOption="true" />
				</table>
			</td>
		</tr>

		<tr>
			<td colspan="2">
				<div id="btnHolder">
					<input type="reset" value="Reset" name="Cancel" class="btn"
						style="position:relative; left: -77px;"
						onclick="Func1Delay()">
					<s:submit action="%{actionMethod}" key="Ok" cssClass="btn"
						id="okbtn" cssStyle="position:relative; left:-175px; top:-26px;" />
				</div>
			</td>
		</tr>
		
	</table>

	<script type="text/javascript">
	function clickOK() {
		document.getElementById('okbtn').click();
	}

	function Func1Delay()
	{
		setTimeout("clickOK()", 100);
	}
	</script>


	<table width="67%">
		<tr>
			<td colspan="2">
				<display:table name="listModel"
				requestURI="TimeOffAction_list" class="listable" cellpadding="0"
				cellspacing="0" pagesize="12">
				<display:column property="employee.person.name" title="Employee"
					sortable="true" />
				<display:column property="timeOffType" title="TimeOff Type" decorator="com.hexacta.hrs.web.util.TimeOffTypesDecorator"
					sortable="true" />
				<display:column property="dateFrom" title="Date From"
					sortable="true" format="{0,date,dd/MM/yyyy}" />
				<display:column property="dateTo" title="Date To" sortable="true"
					format="{0,date,dd/MM/yyyy}" />
				<display:column property="currentStatusDetail.status"
					title="Current Status" sortable="true" />
				<s:url id="view_action" action="TimeOffAction_show" />
				<s:if test="%{hasPermission(permissionNameConverter.getViewAllEmployeesTimeOffAndCompDaysPermission()) || hasPermission(permissionNameConverter.getViewEmployeesTimeOffAndCompDaysPermission())}" >
					<display:column value="View" href="${view_action}"
						paramId="requestId" paramProperty="id" title="Options" />
				</s:if>
				</display:table>
			</td>
		</tr>
	</table>

</s:form>
